<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('意见反馈列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								内容：<input type="text" name="content" maxlength="20"/>
							</li>
							<li>
								用户名：<input type="text" name="createBy" maxlength="10"/>
							</li>
							<li>
								注册手机：<input type="text" name="phoneNumber" maxlength="11"/>
							</li>



							<li class="select-time">
								<label>发布时间: </label>
								<input startDate type="text" autocomplete="off"  id="startTime" placeholder="开始时间" name="params[startTime]"/>
								<span>-</span>
								<input endDate type="text" autocomplete="off"  id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>


							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">

			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">

        var prefix = ctx + "second/freeback";

        $(function() {
            var options = {
                url: prefix + "/list",
				detailUrl: prefix + "/detail/{id}",
                modalName: "意见反馈",
                columns: [

				{
					field : 'content', 
					title : '内容',
					align: 'center',
					switchable: true,
					//表格超出宽度鼠标悬停显示td内容
					formatter: function(value,row,index,field){
						var span = document.createElement('span');
						span.setAttribute('title',value);
						span.innerHTML = value;
						return span.outerHTML;
					},
					//td宽度及内容超过宽度隐藏
					cellStyle : function(value, row, index, field){
						return {
							css: {"min-width": '150px',
								"white-space": 'nowrap',
								"text-overflow": 'ellipsis',
								"overflow": 'hidden',
								"max-width":'200px'
							}
						}
					}
				},
				{
					field : 'remark',
					title : '用户名',
					align: 'center'
				},
				{
					field : 'phoneNumber', 
					title : '注册手机',
					align: 'center'
				},

				{
					field : 'createTime', 
					title : '创建时间',
					sortable: true
				},

		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
						actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-search"></i>详情</a>&nbsp;&nbsp;');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
		function detail(id, width, height) {
			if ($.common.isEmpty(width)) {
				width = 800;
			};
			if ($.common.isEmpty(height)) {
				height = ($(window).height() - 50);
			};
			var index = layer.open({
				type: 2,
				area: [width + 'px', height + 'px'],
				fix: false,
				//不固定
				maxmin: true,
				shade: 0.3,
				title: '详情',
				content: $.operate.detailUrl(id),
				// 弹层外区域关闭
				shadeClose: true,
			});
			layer.full(index);
		}
    </script>
</body>
</html>